﻿@using CampusSite.Models;
@using Campus.Entities;

<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/css/bootstrap.css")" rel="stylesheet" type="text/css" />
    @*<link href="@Url.Content("~/Content/css/bootstrap-responsive.css")" rel="stylesheet" type="text/css" />*@
    <link href="@Url.Content("~/Content/css/bootstrap.min.css")" rel="stylesheet" type="text/css" />

    <link href="@Url.Content("~/Content/css/campussite.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/css/campussiteMJ.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="Stylesheet" type="text/css"/>

    <style type="text/css">
        body
        {
            padding-top: 60px;
            padding-bottom: 40px;
        }
        .sidebar-nav
        {
            padding: 9px 0;
        }
    </style>
    @RenderSection("Header", required: false)
    
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->


</head>
<body>
        
    @{
        //User usuario =  Session["Usuario"] != null ? ((Campus.Entities.User) Session["Usuario"])  : null;
        
        if (User.Identity.IsAuthenticated  )
        {    
            if(ViewBag.UserRol == Constantes.RolResponsable)
            {
                @Html.Partial("NavBarResponsable")
            }
            else if(ViewBag.UserRol == Constantes.RolAdministrador)
            {            
                @Html.Partial("NavBar")
            }
            else
            {
                @Html.Partial("_NavBarEmpty")         
            }
        }
        else
        {
            @Html.Partial("_NavBarEmpty")         
        }
        
    } 
        <div class="container-fluid">
            <div class="row-fluid">
                
                <div class="span12">
       
                    @RenderBody()
       
                </div>
            </div>
            <div id="footer">
            </div>
        </div>
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
    
    <script src="@Url.Content("~/Scripts/bootstrap.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>    


    @RenderSection("footer", required: false)
    <script type="text/javascript">
        $(function () {
            $(".date").datepicker({ dateFormat: "dd/mm/yyyy" });
            $(":input[data-datepicker=true]").datepicker({ dateFormat: "dd/mm/yy" });
            $("input[data-autocomplete-source]").each(function () {
                var target = $(this);
                target.autocomplete(
                {
                    source: target.attr("data-autocomplete-source"),
                    //change: function (event, ui) { alert(ui.item.id); },
                    select: function (event, ui) {
                        $("#btnBuscar").attr("href", "/Estudiantes/Detail/" + ui.item.id);
                        $("[name='estudianteId']").attr("value", ui.item.id);
                        $("[name='estudianteNombre']").attr("value", ui.item.nombre);
                        $("[name='estudianteApellido']").attr("value", ui.item.apellido);
                    }
                });
            });

            //El problemael problema del tooltip en el boton popup de pago era por $("#btnPagar").popover()
            // y porque faltaba agregar la llamada a la funcion $("#btnPagar").tooltip();

            //$("#btnPagar").popover();  
            $("#btnPagar").tooltip();
            $("#btnBuscar").tooltip();            
            $(":input").first().focus();

            $("#btnSubmit").one('click', function (event) {
                event.preventDefault();
                //do something
                //alert("prueba");
                $(this).prop('disabled', true);

                document.forms[0].submit();
            });


        });
    </script>
</body>
</html>
